package org.metasketch.editor.project;

import org.metasketch.editor.Project;
import org.metasketch.graphics.Diagram;
import org.metasketch.graphics.DiagramSet;
import org.metasketch.model.BaseModel;

public class CommonProject extends Project {

	protected BaseModel model;

	protected DiagramSet diagrams = new DiagramSet();

	public boolean isDirty() {

		return (model.containsStuff() && dirty)
				|| (diagrams.containsStuff() && dirty);

	}

	public void addDiagram(Diagram diagram) {
		diagrams.getDiagrams().add(diagram);
		triggerListeners();
	}

	public BaseModel getModel() {
		return model;
	}

	public void setModel(BaseModel model) {
		this.model = model;
	}

	public DiagramSet getDiagrams() {
		return diagrams;
	}

	public void setDiagrams(DiagramSet graphics) {
		this.diagrams = graphics;
	}

	@Override
	public void compileIndexes() {
		model.compileIndex();
		// diagrams.co

	}

}
